﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CollegeShop.Infrastructure.Component.Support
{
    public class CollegeManager
    {
        /// <summary>
        /// 根据域名获取所对应的学校
        /// </summary>
        /// <returns></returns>
        public static string getCollegeName()
        {
            string host = System.Web.HttpContext.Current.Request.Url.Host;
            if (host.StartsWith("www."))
            {
                host = host.Substring(4);
            }
            switch (host)
            {
                default:
                case "10sugou.com":
                    return "重庆大学";
            }
        }

        /// <summary>
        /// 根据域名获取所对应的学校代码
        /// </summary>
        /// <returns></returns>
        public static string GetCollegeCode()
        {
            string host = System.Web.HttpContext.Current.Request.Url.Host;
            if (host.StartsWith("www."))
            {
                host = host.Substring(4);
            }
            switch (host)
            {
                default:
                case "10sugou.com":
                    return "101";
            }
        }
    }
}
